﻿using M.Warehouse.API.Application.Command.BinLocationsCommand;
using M.Warehouse.Domain;
using M.Warehouse.Repository.WarehouseInterface;
using MediatR;

namespace M.Warehouse.API.Application.CommandHandlers.BinLocationsCommandHandlers
{
    /// <summary>
    ///反填库位信息
    /// </summary>
    public class BinLocationsByidCommandHandlers : IRequestHandler<BinLocationsByidCommand, BinLocations>
    {
        private readonly IBinLocationsRepository _repository;
        public BinLocationsByidCommandHandlers(IBinLocationsRepository repository)
        {
            _repository = repository;
        }
        public async Task<BinLocations> Handle(BinLocationsByidCommand request, CancellationToken cancellationToken)
        {
            return await _repository.GetModelAsync(request.BinLocationId);
        }
    }
}
